"""Added image table

Revision ID: ca01506184b5
Revises: 9de2db27ca6e
Create Date: 2023-11-04 02:21:28.077631

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'ca01506184b5'
down_revision: Union[str, None] = '9de2db27ca6e'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('photo',
    sa.Column('message_id', sa.Integer(), nullable=False),
    sa.Column('media_group_id', sa.Integer(), nullable=False),
    sa.Column('post_id', sa.Uuid(), nullable=False),
    sa.ForeignKeyConstraint(['post_id'], ['post.uuid'], ),
    sa.PrimaryKeyConstraint('message_id')
    )
    op.drop_column('post', 'images')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('post', sa.Column('images', sa.VARCHAR(), autoincrement=False, nullable=False))
    op.drop_table('photo')
    # ### end Alembic commands ###
